<?php
/**
 * 	app后台等级
 * 	=============================
 *  Date: 2017-12-06
 * @author Administrator
 *
 */
namespace app\walletyhbbadmin\controller;
use Think\Db;
class Coupon extends AdminBase{
	//空操作
	public function _initialize(){
		parent::_initialize();
	}

    /**
     * 关于我们
     */
    public function index()
    {
        $res = DB::name('Website')->find();
        $arr = DB::name('Website_us')->find();
        $list = DB::name('Website_jp')->find();
        $this->assign('res',$res);
        $this->assign('arr',$arr);
        $this->assign('list',$list);
        return $this->fetch();
    }
    public function edit()
    {
        $id = input('id');
        $data['w_xinxi'] = input('xinxi');
        $arr['w_xinxi'] = input('uxinxi');
        $list['w_xinxi'] = input('jxinxi');
//        $data['w_title'] = input('title');
//        $data['w_keywords'] = input('keywords');
//        $arr['w_keywords'] = input('ukeywords');
//        $list['w_keywords'] = input('jkeywords');

//        $data['w_description'] = input('phone');
//        $arr['w_description'] = input('phone');
//        $list['w_description'] = input('phone');

//        $data['w_email'] = input('email');
//        $arr['w_email'] = input('email');
//        $list['w_email'] = input('email');

//        $data['w_emailzl'] = input('emailzl');
//        $arr['w_emailzl'] = input('emailzl');
//        $list['w_emailzl'] = input('emailzl');

//        $data['w_chanzhen'] = input('chuanzhen');
//        $arr['w_chanzhen'] = input('chuanzhen');
//        $list['w_chanzhen'] = input('chuanzhen');

//        $data['w_qq'] = input('qq');
//        $arr['w_qq'] = input('qq');
//        $list['w_qq'] = input('qq');

        $data['w_jianjie'] = input('jianjie');
        $arr['w_jianjie'] = input('ujianjie');
        $list['w_jianjie'] = input('jjianjie');
//        if( $data['w_title'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_xinxi'] == null || $arr['w_xinxi'] == null || $list['w_xinxi'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_keywords'] == null || $arr['w_keywords'] == null || $list['w_keywords'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_description'] == null || $arr['w_description'] == null || $list['w_description'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_email'] == null ||  $arr['w_email'] == null || $list['w_email'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_jianjie'] == null || $arr['w_jianjie'] == null || $list['w_jianjie'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_chanzhen'] == null ||  $arr['w_chanzhen'] == null ||  $list['w_chanzhen'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_qq'] == null || $arr['w_qq'] == null || $list['w_qq'] == null)
//        {
//            $this->error('请完善信息');
//        }
        $li = DB::name('Website')->where('w_id',$id)->update($data);
        $li1 = DB::name('Website_us')->where('w_id',$id)->update($arr);
        $li2 = DB::name('Website_jp')->where('w_id',$id)->update($list);

            $this->success('修改成功','coupon/index');

    }


    /**
     * 企业文化
     */
    public function culture()
    {
        $jieshao = DB::name('Website')->find();
        $arr = DB::name('Website_us')->find();
        $list = DB::name('Website_jp')->find();
        $this->assign('jieshao',$jieshao);
        $this->assign('arr',$arr);
        $this->assign('list',$list);
        return $this->fetch();
    }
    public function editculture()
    {
        $id = input('id');
//        dump($id);die();
//        $data['w_zongzhi'] = input('zongzhi');
//        $arr['w_zongzhi'] = input('uzongzhi');
//        $list['w_zongzhi'] = input('jzongzhi');
//
//        $data['w_linian'] = input('linian');
//        $arr['w_linian'] = input('ulinian');
//        $list['w_linian'] = input('jlinian');
//
//        $data['w_shiming'] = input('shiming');
//        $arr['w_shiming'] = input('ushiming');
//        $list['w_shiming'] = input('jshiming');
//
//        $data['w_zhanlue'] = input('zhanlue');
//        $arr['w_zhanlue'] = input('uzhanlue');
//        $list['w_zhanlue'] = input('jzhanlue');
//
//        $data['w_yuanjing'] = input('yuanjing');
//        $arr['w_yuanjing'] = input('uyuanjing');
//        $list['w_yuanjing'] = input('jyuanjing');
//
//        $data['w_nengli'] = input('nengli');
//        $arr['w_nengli'] = input('unengli');
//        $list['w_nengli'] = input('jnengli');
//
//        if( $data['w_zongzhi'] == null ||  $arr['w_zongzhi'] == null ||  $list['w_zongzhi'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_linian'] == null ||  $arr['w_linian'] == null ||  $list['w_linian'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_shiming'] == null ||  $arr['w_shiming'] == null ||  $list['w_shiming'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_zhanlue'] == null || $arr['w_zhanlue'] == null ||  $list['w_zhanlue'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_yuanjing'] == null || $arr['w_yuanjing'] == null || $list['w_yuanjing'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        if( $data['w_nengli'] == null ||  $arr['w_nengli'] == null ||  $list['w_nengli'] == null)
//        {
//            $this->error('请完善信息');
//        }
//        dump($data);die();
        $data['w_wenhua'] = input('wenhua');
        $arr['w_wenhua'] = input('uwenhua');
        $list['w_wenhua'] = input('jwenhua');
//        dump($data);
//        dump($arr);
//        dump($list);
        $res = DB::name('Website')->where('w_id',$id)->update($data);
        $res1 = DB::name('Website_us')->where('w_id',$id)->update($arr);
        $res2 = DB::name('Website_jp')->where('w_id',$id)->update($list);

            $this->success('操作成功');

    }


}